﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conc_classes_data;

namespace Server
{
    public class server
    {
        private List<tank> _Tanks = new List<tank>(3);
        public List<tank> Tanks
        {
            get { return _Tanks; }            
        }
        
        private List<tank_controller> _tank_controllers = new List<tank_controller>(3);
        public List<tank_controller> Tank_controllers
        {
            get { return _tank_controllers; }
        }

        private List<trk_controller> _trk_controllers = new List<trk_controller>(3);
        public List<trk_controller> TRK_controllers
        {
            get { return _trk_controllers; }
        }

        private List<pump_controller> _pump_controllers = new List<pump_controller>(3);
        public List<pump_controller> Pump_controllers
        {
            get { return _pump_controllers; }
        }

        private List<temp_controller> _temp_controllers = new List<temp_controller>(3);
        public List<temp_controller> Temp_controllers
        {
            get { return _temp_controllers; }
        }

        public server()
        {
        }

        public void Init()
        {
            for (int i = 0; i < 3; i++)
            {
                tank t_tmp = new tank(1200);
                _Tanks.Add(t_tmp);

                tank_controller c_tmp = new tank_controller(t_tmp, 50);
                _tank_controllers.Add(c_tmp);
                c_tmp.StartChecking();

                trk_controller trk_tmp = new trk_controller(t_tmp, 50);
                _trk_controllers.Add(trk_tmp);
                
                pump_controller pump_tmp = new pump_controller(t_tmp, 300);
                _pump_controllers.Add(pump_tmp);
                pump_tmp.StartChecking();

                temp_controller temp_tmp = new temp_controller(t_tmp, 60);
                _temp_controllers.Add(temp_tmp);
                temp_tmp.StartChecking();
            }
        }
    }
}
